3.1.11 \(\int \frac {1+2 x}{(1+x^2) \sqrt {-1+x+x^2}} \, dx\) [11]

Optimal. Leaf size=117 \[ -\sqrt {\frac {1}{2} \left (2+\sqrt {5}\right )} \tan ^{-1}\left (\frac {5+2 \sqrt {5}-\sqrt {5} x}{\sqrt {10 \left (2+\sqrt {5}\right )} \sqrt {-1+x+x^2}}\right )+\sqrt {\frac {1}{2} \left (-2+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {5-2 \sqrt {5}+\sqrt {5} x}{\sqrt {10 \left (-2+\sqrt {5}\right )} \sqrt {-1+x+x^2}}\right ) \]

[Out]

1/2*arctanh((5-2*5^(1/2)+x*5^(1/2))/(x^2+x-1)^(1/2)/(-20+10*5^(1/2))^(1/2))*(-4+2*5^(1/2))^(1/2)-1/2*arctan((5
+2*5^(1/2)-x*5^(1/2))/(x^2+x-1)^(1/2)/(20+10*5^(1/2))^(1/2))*(4+2*5^(1/2))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.11, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {1050, 1044, 213, 209} \begin {gather*} \sqrt {\frac {1}{2} \left (\sqrt {5}-2\right )} \tanh ^{-1}\left (\frac {\sqrt {5} x-2 \sqrt {5}+5}{\sqrt {10 \left (\sqrt {5}-2\right )} \sqrt {x^2+x-1}}\right )-\sqrt {\frac {1}{2} \left (2+\sqrt {5}\right )} \text {ArcTan}\left (\frac {-\sqrt {5} x+2 \sqrt {5}+5}{\sqrt {10 \left (2+\sqrt {5}\right )} \sqrt {x^2+x-1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + 2*x)/((1 + x^2)*Sqrt[-1 + x + x^2]),x]

[Out]

-(Sqrt[(2 + Sqrt[5])/2]*ArcTan[(5 + 2*Sqrt[5] - Sqrt[5]*x)/(Sqrt[10*(2 + Sqrt[5])]*Sqrt[-1 + x + x^2])]) + Sqr
t[(-2 + Sqrt[5])/2]*ArcTanh[(5 - 2*Sqrt[5] + Sqrt[5]*x)/(Sqrt[10*(-2 + Sqrt[5])]*Sqrt[-1 + x + x^2])]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 1044

Int[((g_) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> Dist[-2*
a*g*h, Subst[Int[1/Simp[2*a^2*g*h*c + a*e*x^2, x], x], x, Simp[a*h - g*c*x, x]/Sqrt[d + e*x + f*x^2]], x] /; F
reeQ[{a, c, d, e, f, g, h}, x] && EqQ[a*h^2*e + 2*g*h*(c*d - a*f) - g^2*c*e, 0]

Rule 1050

Int[((g_.) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> With[{q
 = Rt[(c*d - a*f)^2 + a*c*e^2, 2]}, Dist[1/(2*q), Int[Simp[(-a)*h*e - g*(c*d - a*f - q) + (h*(c*d - a*f + q) -
 g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x] - Dist[1/(2*q), Int[Simp[(-a)*h*e - g*(c*d - a*f + q
) + (h*(c*d - a*f - q) - g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x]] /; FreeQ[{a, c, d, e, f, g,
 h}, x] && NeQ[e^2 - 4*d*f, 0] && NegQ[(-a)*c]

Rubi steps

\begin {align*} \int \frac {1+2 x}{\left (1+x^2\right ) \sqrt {-1+x+x^2}} \, dx &=-\frac {\int \frac {-\sqrt {5}+\left (-5-2 \sqrt {5}\right ) x}{\left (1+x^2\right ) \sqrt {-1+x+x^2}} \, dx}{2 \sqrt {5}}+\frac {\int \frac {\sqrt {5}+\left (-5+2 \sqrt {5}\right ) x}{\left (1+x^2\right ) \sqrt {-1+x+x^2}} \, dx}{2 \sqrt {5}}\\ &=-\left (\left (-5+2 \sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{10 \left (2-\sqrt {5}\right )+x^2} \, dx,x,\frac {-5+2 \sqrt {5}-\sqrt {5} x}{\sqrt {-1+x+x^2}}\right )\right )+\left (5+2 \sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{10 \left (2+\sqrt {5}\right )+x^2} \, dx,x,\frac {-5-2 \sqrt {5}+\sqrt {5} x}{\sqrt {-1+x+x^2}}\right )\\ &=-\sqrt {\frac {1}{2} \left (2+\sqrt {5}\right )} \tan ^{-1}\left (\frac {5+2 \sqrt {5}-\sqrt {5} x}{\sqrt {10 \left (2+\sqrt {5}\right )} \sqrt {-1+x+x^2}}\right )+\sqrt {\frac {1}{2} \left (-2+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {5-2 \sqrt {5}+\sqrt {5} x}{\sqrt {10 \left (-2+\sqrt {5}\right )} \sqrt {-1+x+x^2}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
time = 0.12, size = 106, normalized size = 0.91 \begin {gather*} \frac {1}{2} \text {RootSum}\left [2-4 \text {$\#$1}+6 \text {$\#$1}^2+\text {$\#$1}^4\&,\frac {3 \log \left (-x+\sqrt {-1+x+x^2}-\text {$\#$1}\right )-2 \log \left (-x+\sqrt {-1+x+x^2}-\text {$\#$1}\right ) \text {$\#$1}+2 \log \left (-x+\sqrt {-1+x+x^2}-\text {$\#$1}\right ) \text {$\#$1}^2}{-1+3 \text {$\#$1}+\text {$\#$1}^3}\&\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + 2*x)/((1 + x^2)*Sqrt[-1 + x + x^2]),x]

[Out]

RootSum[2 - 4*#1 + 6*#1^2 + #1^4 & , (3*Log[-x + Sqrt[-1 + x + x^2] - #1] - 2*Log[-x + Sqrt[-1 + x + x^2] - #1
]*#1 + 2*Log[-x + Sqrt[-1 + x + x^2] - #1]*#1^2)/(-1 + 3*#1 + #1^3) & ]/2

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(636\) vs. \(2(86)=172\).
time = 0.55, size = 637, normalized size = 5.44

method result size
trager \(-\RootOf \left (\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+\textit {\_Z}^{2}+1\right ) \ln \left (\frac {4 \RootOf \left (\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+\textit {\_Z}^{2}+1\right ) \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2} x +2 \RootOf \left (\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+\textit {\_Z}^{2}+1\right ) x -\sqrt {x^{2}+x -1}+\RootOf \left (\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+\textit {\_Z}^{2}+1\right )}{4 x \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+2 x -1}\right )+\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right ) \ln \left (\frac {4 \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{3} x +2 \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right ) x -\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )-\sqrt {x^{2}+x -1}}{4 x \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+2 x +1}\right )\) \(248\)
default \(\frac {\sqrt {\frac {10 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\frac {5 \sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+10+5 \sqrt {5}}\, \sqrt {5}\, \left (\arctan \left (\frac {\sqrt {5}\, \sqrt {\left (-2+\sqrt {5}\right ) \left (-\frac {\left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+4 \sqrt {5}+9\right )}\, \sqrt {20+10 \sqrt {5}}\, \left (\frac {\sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+\frac {2 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\sqrt {5}+2\right ) \left (-\sqrt {5}-2+x \right ) \left (-2+\sqrt {5}\right )}{5 \left (-\sqrt {5}+2-x \right ) \left (\frac {\left (-\sqrt {5}-2+x \right )^{4}}{\left (-\sqrt {5}+2-x \right )^{4}}-\frac {18 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+1\right )}\right ) \sqrt {5}+\arctanh \left (\frac {\sqrt {\frac {10 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\frac {5 \sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+10+5 \sqrt {5}}}{\sqrt {20+10 \sqrt {5}}}\right )+2 \arctan \left (\frac {\sqrt {5}\, \sqrt {\left (-2+\sqrt {5}\right ) \left (-\frac {\left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+4 \sqrt {5}+9\right )}\, \sqrt {20+10 \sqrt {5}}\, \left (\frac {\sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+\frac {2 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\sqrt {5}+2\right ) \left (-\sqrt {5}-2+x \right ) \left (-2+\sqrt {5}\right )}{5 \left (-\sqrt {5}+2-x \right ) \left (\frac {\left (-\sqrt {5}-2+x \right )^{4}}{\left (-\sqrt {5}+2-x \right )^{4}}-\frac {18 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+1\right )}\right )\right )}{\sqrt {-\frac {5 \left (\frac {\sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\frac {2 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\sqrt {5}-2\right )}{\left (1+\frac {-\sqrt {5}-2+x}{-\sqrt {5}+2-x}\right )^{2}}}\, \left (1+\frac {-\sqrt {5}-2+x}{-\sqrt {5}+2-x}\right ) \sqrt {20+10 \sqrt {5}}}\) \(637\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x+1)/(x^2+1)/(x^2+x-1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

(10*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2-5*5^(1/2)*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2+10+5*5^(1/2))^(1/2)*5^(1/2)*
(arctan(1/5*5^(1/2)*((-2+5^(1/2))*(-(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2+4*5^(1/2)+9))^(1/2)*(20+10*5^(1/2))^(1/2
)*(5^(1/2)*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2+2*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2-5^(1/2)+2)*(-5^(1/2)-2+x)/(-5
^(1/2)+2-x)*(-2+5^(1/2))/((-5^(1/2)-2+x)^4/(-5^(1/2)+2-x)^4-18*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2+1))*5^(1/2)+a
rctanh((10*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2-5*5^(1/2)*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2+10+5*5^(1/2))^(1/2)/(
20+10*5^(1/2))^(1/2))+2*arctan(1/5*5^(1/2)*((-2+5^(1/2))*(-(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2+4*5^(1/2)+9))^(1/
2)*(20+10*5^(1/2))^(1/2)*(5^(1/2)*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2+2*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2-5^(1/2
)+2)*(-5^(1/2)-2+x)/(-5^(1/2)+2-x)*(-2+5^(1/2))/((-5^(1/2)-2+x)^4/(-5^(1/2)+2-x)^4-18*(-5^(1/2)-2+x)^2/(-5^(1/
2)+2-x)^2+1)))/(-5*(5^(1/2)*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2-2*(-5^(1/2)-2+x)^2/(-5^(1/2)+2-x)^2-5^(1/2)-2)/(
1+(-5^(1/2)-2+x)/(-5^(1/2)+2-x))^2)^(1/2)/(1+(-5^(1/2)-2+x)/(-5^(1/2)+2-x))/(20+10*5^(1/2))^(1/2)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+2*x)/(x^2+1)/(x^2+x-1)^(1/2),x, algorithm="maxima")

[Out]

integrate((2*x + 1)/(sqrt(x^2 + x - 1)*(x^2 + 1)), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 758 vs. \(2 (86) = 172\).
time = 0.37, size = 758, normalized size = 6.48 \begin {gather*} \frac {1}{20} \cdot 5^{\frac {1}{4}} \sqrt {4 \, \sqrt {5} + 10} {\left (2 \, \sqrt {5} - 5\right )} \log \left (2 \, x^{2} - 2 \, \sqrt {x^{2} + x - 1} x + \frac {1}{5} \, {\left (5^{\frac {1}{4}} \sqrt {x^{2} + x - 1} {\left (2 \, \sqrt {5} - 5\right )} - 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5 \, x\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + x + \sqrt {5}\right ) - \frac {1}{20} \cdot 5^{\frac {1}{4}} \sqrt {4 \, \sqrt {5} + 10} {\left (2 \, \sqrt {5} - 5\right )} \log \left (2 \, x^{2} - 2 \, \sqrt {x^{2} + x - 1} x - \frac {1}{5} \, {\left (5^{\frac {1}{4}} \sqrt {x^{2} + x - 1} {\left (2 \, \sqrt {5} - 5\right )} - 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5 \, x\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + x + \sqrt {5}\right ) - \frac {1}{5} \cdot 5^{\frac {3}{4}} \sqrt {4 \, \sqrt {5} + 10} \arctan \left (\frac {2}{55} \, \sqrt {5} {\left (\sqrt {5} {\left (2 \, x - 1\right )} + 3 \, x + 4\right )} + \frac {1}{275} \, \sqrt {10 \, x^{2} - 10 \, \sqrt {x^{2} + x - 1} x + {\left (5^{\frac {1}{4}} \sqrt {x^{2} + x - 1} {\left (2 \, \sqrt {5} - 5\right )} - 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5 \, x\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + 5 \, x + 5 \, \sqrt {5}} {\left ({\left (5^{\frac {3}{4}} {\left (2 \, \sqrt {5} + 3\right )} + 2 \cdot 5^{\frac {1}{4}} {\left (4 \, \sqrt {5} - 5\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + 2 \, \sqrt {5} {\left (3 \, \sqrt {5} + 10\right )} - 20 \, \sqrt {5} + 80\right )} - \frac {2}{55} \, \sqrt {x^{2} + x - 1} {\left (\sqrt {5} {\left (2 \, \sqrt {5} + 3\right )} + 8 \, \sqrt {5} - 10\right )} + \frac {1}{55} \, \sqrt {5} {\left (16 \, x + 3\right )} + \frac {1}{275} \, {\left (5^{\frac {3}{4}} {\left (\sqrt {5} {\left (3 \, x + 4\right )} + 10 \, x - 5\right )} - \sqrt {x^{2} + x - 1} {\left (5^{\frac {3}{4}} {\left (3 \, \sqrt {5} + 10\right )} - 10 \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} - 4\right )}\right )} - 10 \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (x - 6\right )} - 4 \, x + 13\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} - \frac {4}{11} \, x + \frac {2}{11}\right ) - \frac {1}{5} \cdot 5^{\frac {3}{4}} \sqrt {4 \, \sqrt {5} + 10} \arctan \left (-\frac {2}{55} \, \sqrt {5} {\left (\sqrt {5} {\left (2 \, x - 1\right )} + 3 \, x + 4\right )} + \frac {1}{275} \, \sqrt {10 \, x^{2} - 10 \, \sqrt {x^{2} + x - 1} x - {\left (5^{\frac {1}{4}} \sqrt {x^{2} + x - 1} {\left (2 \, \sqrt {5} - 5\right )} - 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5 \, x\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + 5 \, x + 5 \, \sqrt {5}} {\left ({\left (5^{\frac {3}{4}} {\left (2 \, \sqrt {5} + 3\right )} + 2 \cdot 5^{\frac {1}{4}} {\left (4 \, \sqrt {5} - 5\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} - 2 \, \sqrt {5} {\left (3 \, \sqrt {5} + 10\right )} + 20 \, \sqrt {5} - 80\right )} + \frac {2}{55} \, \sqrt {x^{2} + x - 1} {\left (\sqrt {5} {\left (2 \, \sqrt {5} + 3\right )} + 8 \, \sqrt {5} - 10\right )} - \frac {1}{55} \, \sqrt {5} {\left (16 \, x + 3\right )} + \frac {1}{275} \, {\left (5^{\frac {3}{4}} {\left (\sqrt {5} {\left (3 \, x + 4\right )} + 10 \, x - 5\right )} - \sqrt {x^{2} + x - 1} {\left (5^{\frac {3}{4}} {\left (3 \, \sqrt {5} + 10\right )} - 10 \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} - 4\right )}\right )} - 10 \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (x - 6\right )} - 4 \, x + 13\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + \frac {4}{11} \, x - \frac {2}{11}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+2*x)/(x^2+1)/(x^2+x-1)^(1/2),x, algorithm="fricas")

[Out]

1/20*5^(1/4)*sqrt(4*sqrt(5) + 10)*(2*sqrt(5) - 5)*log(2*x^2 - 2*sqrt(x^2 + x - 1)*x + 1/5*(5^(1/4)*sqrt(x^2 +
x - 1)*(2*sqrt(5) - 5) - 5^(1/4)*(sqrt(5)*(2*x + 1) - 5*x))*sqrt(4*sqrt(5) + 10) + x + sqrt(5)) - 1/20*5^(1/4)
*sqrt(4*sqrt(5) + 10)*(2*sqrt(5) - 5)*log(2*x^2 - 2*sqrt(x^2 + x - 1)*x - 1/5*(5^(1/4)*sqrt(x^2 + x - 1)*(2*sq
rt(5) - 5) - 5^(1/4)*(sqrt(5)*(2*x + 1) - 5*x))*sqrt(4*sqrt(5) + 10) + x + sqrt(5)) - 1/5*5^(3/4)*sqrt(4*sqrt(
5) + 10)*arctan(2/55*sqrt(5)*(sqrt(5)*(2*x - 1) + 3*x + 4) + 1/275*sqrt(10*x^2 - 10*sqrt(x^2 + x - 1)*x + (5^(
1/4)*sqrt(x^2 + x - 1)*(2*sqrt(5) - 5) - 5^(1/4)*(sqrt(5)*(2*x + 1) - 5*x))*sqrt(4*sqrt(5) + 10) + 5*x + 5*sqr
t(5))*((5^(3/4)*(2*sqrt(5) + 3) + 2*5^(1/4)*(4*sqrt(5) - 5))*sqrt(4*sqrt(5) + 10) + 2*sqrt(5)*(3*sqrt(5) + 10)
 - 20*sqrt(5) + 80) - 2/55*sqrt(x^2 + x - 1)*(sqrt(5)*(2*sqrt(5) + 3) + 8*sqrt(5) - 10) + 1/55*sqrt(5)*(16*x +
 3) + 1/275*(5^(3/4)*(sqrt(5)*(3*x + 4) + 10*x - 5) - sqrt(x^2 + x - 1)*(5^(3/4)*(3*sqrt(5) + 10) - 10*5^(1/4)
*(sqrt(5) - 4)) - 10*5^(1/4)*(sqrt(5)*(x - 6) - 4*x + 13))*sqrt(4*sqrt(5) + 10) - 4/11*x + 2/11) - 1/5*5^(3/4)
*sqrt(4*sqrt(5) + 10)*arctan(-2/55*sqrt(5)*(sqrt(5)*(2*x - 1) + 3*x + 4) + 1/275*sqrt(10*x^2 - 10*sqrt(x^2 + x
 - 1)*x - (5^(1/4)*sqrt(x^2 + x - 1)*(2*sqrt(5) - 5) - 5^(1/4)*(sqrt(5)*(2*x + 1) - 5*x))*sqrt(4*sqrt(5) + 10)
 + 5*x + 5*sqrt(5))*((5^(3/4)*(2*sqrt(5) + 3) + 2*5^(1/4)*(4*sqrt(5) - 5))*sqrt(4*sqrt(5) + 10) - 2*sqrt(5)*(3
*sqrt(5) + 10) + 20*sqrt(5) - 80) + 2/55*sqrt(x^2 + x - 1)*(sqrt(5)*(2*sqrt(5) + 3) + 8*sqrt(5) - 10) - 1/55*s
qrt(5)*(16*x + 3) + 1/275*(5^(3/4)*(sqrt(5)*(3*x + 4) + 10*x - 5) - sqrt(x^2 + x - 1)*(5^(3/4)*(3*sqrt(5) + 10
) - 10*5^(1/4)*(sqrt(5) - 4)) - 10*5^(1/4)*(sqrt(5)*(x - 6) - 4*x + 13))*sqrt(4*sqrt(5) + 10) + 4/11*x - 2/11)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {2 x + 1}{\left (x^{2} + 1\right ) \sqrt {x^{2} + x - 1}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+2*x)/(x**2+1)/(x**2+x-1)**(1/2),x)

[Out]

Integral((2*x + 1)/((x**2 + 1)*sqrt(x**2 + x - 1)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 457 vs. \(2 (86) = 172\).
time = 5.18, size = 457, normalized size = 3.91 \begin {gather*} \frac {1}{4} \, \sqrt {2 \, \sqrt {5} - 4} \log \left (16 \, {\left (15 \, \sqrt {5} {\left (x - \sqrt {x^{2} + x - 1}\right )} + 33 \, x + 5 \, \sqrt {5} - 33 \, \sqrt {x^{2} + x - 1} + 2 \, \sqrt {5 \, \sqrt {5} + 11} + 11\right )}^{2} + 16 \, {\left (5 \, \sqrt {5} {\left (x - \sqrt {x^{2} + x - 1}\right )} + 11 \, x - 5 \, \sqrt {5} \sqrt {5 \, \sqrt {5} + 11} - 15 \, \sqrt {5} - 11 \, \sqrt {x^{2} + x - 1} - 11 \, \sqrt {5 \, \sqrt {5} + 11} - 33\right )}^{2}\right ) - \frac {1}{4} \, \sqrt {2 \, \sqrt {5} - 4} \log \left (16 \, {\left (15 \, \sqrt {5} {\left (x - \sqrt {x^{2} + x - 1}\right )} + 33 \, x + 5 \, \sqrt {5} - 33 \, \sqrt {x^{2} + x - 1} - 2 \, \sqrt {5 \, \sqrt {5} + 11} + 11\right )}^{2} + 16 \, {\left (5 \, \sqrt {5} {\left (x - \sqrt {x^{2} + x - 1}\right )} + 11 \, x + 5 \, \sqrt {5} \sqrt {5 \, \sqrt {5} + 11} - 15 \, \sqrt {5} - 11 \, \sqrt {x^{2} + x - 1} + 11 \, \sqrt {5 \, \sqrt {5} + 11} - 33\right )}^{2}\right ) + \frac {\sqrt {2 \, \sqrt {5} - 4} {\left (\arctan \left (3\right ) + \arctan \left (\frac {1}{10} \, {\left (x - \sqrt {x^{2} + x - 1}\right )} {\left (\sqrt {5} \sqrt {5 \, \sqrt {5} + 11} + 4 \, \sqrt {5} - 5 \, \sqrt {5 \, \sqrt {5} + 11}\right )} - \frac {7}{10} \, \sqrt {5} \sqrt {5 \, \sqrt {5} + 11} + \frac {1}{5} \, \sqrt {5} + \frac {3}{2} \, \sqrt {5 \, \sqrt {5} + 11}\right )\right )}}{2 \, {\left (\sqrt {5} - 2\right )}} - \frac {\sqrt {2 \, \sqrt {5} - 4} {\left (\arctan \left (3\right ) + \arctan \left (-\frac {1}{10} \, {\left (x - \sqrt {x^{2} + x - 1}\right )} {\left (\sqrt {5} \sqrt {5 \, \sqrt {5} + 11} - 4 \, \sqrt {5} - 5 \, \sqrt {5 \, \sqrt {5} + 11}\right )} + \frac {7}{10} \, \sqrt {5} \sqrt {5 \, \sqrt {5} + 11} + \frac {1}{5} \, \sqrt {5} - \frac {3}{2} \, \sqrt {5 \, \sqrt {5} + 11}\right )\right )}}{2 \, {\left (\sqrt {5} - 2\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+2*x)/(x^2+1)/(x^2+x-1)^(1/2),x, algorithm="giac")

[Out]

1/4*sqrt(2*sqrt(5) - 4)*log(16*(15*sqrt(5)*(x - sqrt(x^2 + x - 1)) + 33*x + 5*sqrt(5) - 33*sqrt(x^2 + x - 1) +
 2*sqrt(5*sqrt(5) + 11) + 11)^2 + 16*(5*sqrt(5)*(x - sqrt(x^2 + x - 1)) + 11*x - 5*sqrt(5)*sqrt(5*sqrt(5) + 11
) - 15*sqrt(5) - 11*sqrt(x^2 + x - 1) - 11*sqrt(5*sqrt(5) + 11) - 33)^2) - 1/4*sqrt(2*sqrt(5) - 4)*log(16*(15*
sqrt(5)*(x - sqrt(x^2 + x - 1)) + 33*x + 5*sqrt(5) - 33*sqrt(x^2 + x - 1) - 2*sqrt(5*sqrt(5) + 11) + 11)^2 + 1
6*(5*sqrt(5)*(x - sqrt(x^2 + x - 1)) + 11*x + 5*sqrt(5)*sqrt(5*sqrt(5) + 11) - 15*sqrt(5) - 11*sqrt(x^2 + x -
1) + 11*sqrt(5*sqrt(5) + 11) - 33)^2) + 1/2*sqrt(2*sqrt(5) - 4)*(arctan(3) + arctan(1/10*(x - sqrt(x^2 + x - 1
))*(sqrt(5)*sqrt(5*sqrt(5) + 11) + 4*sqrt(5) - 5*sqrt(5*sqrt(5) + 11)) - 7/10*sqrt(5)*sqrt(5*sqrt(5) + 11) + 1
/5*sqrt(5) + 3/2*sqrt(5*sqrt(5) + 11)))/(sqrt(5) - 2) - 1/2*sqrt(2*sqrt(5) - 4)*(arctan(3) + arctan(-1/10*(x -
 sqrt(x^2 + x - 1))*(sqrt(5)*sqrt(5*sqrt(5) + 11) - 4*sqrt(5) - 5*sqrt(5*sqrt(5) + 11)) + 7/10*sqrt(5)*sqrt(5*
sqrt(5) + 11) + 1/5*sqrt(5) - 3/2*sqrt(5*sqrt(5) + 11)))/(sqrt(5) - 2)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {2\,x+1}{\left (x^2+1\right )\,\sqrt {x^2+x-1}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x + 1)/((x^2 + 1)*(x + x^2 - 1)^(1/2)),x)

[Out]

int((2*x + 1)/((x^2 + 1)*(x + x^2 - 1)^(1/2)), x)

________________________________________________________________________________________